CSharpTest.Net
BTreeDictionary<TKey,TValue> Constructor(IComparer<TKey>,IEnumerable<KeyValuePair<TKey,TValue>>)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Collections Namespace > BTreeDictionary<TKey,TValue> Class > BTreeDictionary<TKey,TValue> Constructor : BTreeDictionary<TKey,TValue> Constructor(IComparer<TKey>,IEnumerable<KeyValuePair<TKey,TValue>>)

comparer
copyFrom

Glossary Item Box

Constructs a BTreeList instance.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal comparer As IComparer(Of TKey), _
   ByVal copyFrom As IEnumerable(Of KeyValuePair(Of TKey,TValue)) _
)
C# 
public BTreeDictionary<TKey,TValue>( 
   IComparer<TKey> comparer,
   IEnumerable<KeyValuePair<TKey,TValue>> copyFrom
)

Parameters

comparer
copyFrom

Example

Library/Library.Test/TestBTreeDictionary.cs

C#Copy Code
BTreeDictionary<int, string> data = new BTreeDictionary<int, string>(Comparer, GetSample());
Assert.IsFalse(data.IsReadOnly);
            
BTreeDictionary<int, string> copy = data.MakeReadOnly();
Assert.IsFalse(ReferenceEquals(data, copy));
Assert.AreEqual(data.Count, copy.Count);
Assert.IsTrue(copy.IsReadOnly);

Assert.IsTrue(ReferenceEquals(copy, copy.MakeReadOnly()));
data = copy.Clone();
Assert.IsFalse(data.IsReadOnly);
Assert.IsFalse(ReferenceEquals(copy, data));
Assert.AreEqual(data.Count, copy.Count);
VB.NETCopy Code
Dim data As New BTreeDictionary(Of Integer, String)(Comparer, GetSample())
Assert.IsFalse(data.IsReadOnly)

Dim copy As BTreeDictionary(Of Integer, String) = data.MakeReadOnly()
Assert.IsFalse(ReferenceEquals(data, copy))
Assert.AreEqual(data.Count, copy.Count)
Assert.IsTrue(copy.IsReadOnly)

Assert.IsTrue(ReferenceEquals(copy, copy.MakeReadOnly()))
data = copy.Clone()
Assert.IsFalse(data.IsReadOnly)
Assert.IsFalse(ReferenceEquals(copy, data))
Assert.AreEqual(data.Count, copy.Count)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys